<template>
  <div class="supervisionDetail">
    <Head :head="head" @greet="greet"></Head>
    <el-dialog
      :visible.sync="centerDialogVisible"
      width="1000px"
      center>
      <div class="left_essential base">
        <img src="/static/assets/img/dtx1.png" alt="">
        <p v-for="(c,index) in cs" @click="sorts($event, index, c.t)" v-bind:class="{'visible1':nowIndex == index}" :key="c.index">{{ c.name }}</p>
      </div>
      <div class="right_essential" v-if="temp1 == 1">
        <p>尊敬的{{user}}用户，胸痛质控大家庭感谢您的加入</p>
        <div><p><span>组织</span></p><p><span>个人资料</span></p></div>
        <div><p><span>头像</span><img src="/static/assets/img/logo.png" alt=""></p><p><span>姓名</span>{{user}}</p><p><span>头像</span><img src="/static/assets/img/dtx.png" alt=""></p></div>
        <div><p><span>权限</span>{{user}}</p><p><span>权限</span>{{user}}</p></div>
        <div><p><span>简称</span>{{user}}</p><p><span>职务</span>{{user}}</p><p><span>科室</span>{{user}}></p></div>
        <div><p></p><p><span>手机</span>{{user}}<span class="tip">已绑定</span></p><p><span>邮箱</span>{{user}}<span class="tip">已验证</span></p></div>
      </div>
      <div class="right_essential" v-if="temp1 == 2">
        <p>您的安全服务</p>
        <div><p><span class="width_user">用户名</span>{{user}}</p></div>
        <div><p><span>绑定邮箱</span></p><span class="tip2">修改邮箱</span></div>
        <div><p><span>绑定手机</span>{{user}}</p></div>
        <div><p><span>登录密码</span>{{user}}</p><span class="tip2">修改邮箱</span></div>
      </div>
      <div class="both"></div>
    </el-dialog>
    <div class="full-screen-height">
      <el-container class="full-height">
        <el-main class="p-0 of-hidden">
          <div class="main">
            <el-table
              :data="tableData"
              :height="tableHeight"
              style="width: 100%">
              <el-table-column type="selection" width="50" class="hide"></el-table-column>
              <el-table-column
                prop="province"
                width="80"
                align="center"
                :filters="[{text: '江苏', value: '江苏'}]"
                label="省">
              </el-table-column>
              <el-table-column
                prop="city"
                width="80"
                align="center"
                :filters="[{text: '苏州', value: '苏州'}]"
                label="市">
              </el-table-column>
              <el-table-column
                prop="hospital"
                align="center"
                label="医院">
              </el-table-column>
              <el-table-column
                prop="person"
                align="center"
                label="负责人">
              </el-table-column>
              <el-table-column
                prop="phone"
                align="center"
                label="电话">
              </el-table-column>
              <el-table-column
                prop="email"
                align="center"
                label="邮箱">
                <template slot-scope="scope">
                  <div style="color: #8D3FDA">{{scope.row.email}}</div>
                </template>
              </el-table-column>
              <el-table-column width="80">
                <template slot="header" slot-scope="scope">
                  <button type="button" class="btn_color" @click="sends(scope)">督导</button>
                </template>
                <template slot-scope="scope">
                  <button type="button" class="btn_color" @click="send(scope)">督导</button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </el-main>
      </el-container>
    </div>
    <el-dialog
      class="foot-center"
      :visible.sync="showDialog"
      width="360px">
      <div class="text-center">
        <img src="/static/assets/img/supervision/fs.png" width="206" height="101" alt="">
        <div class="mt-15 text-16">
          {{dialogText}}
        </div>
      </div>
      <span slot="footer">
        <el-button @click="showDialog = false" type="info" round>取 消</el-button>
        <el-button type="primary" @click="confirmSend" round>确 认</el-button>
      </span>
    </el-dialog>
    <el-dialog
      class="foot-center"
      :visible.sync="afterSend"
      width="360px">
      <div class="text-center">
        <img src="/static/assets/img/supervision/sb.png" class="my-20" width="48" height="38" alt="">
        <div class="mt-15 text-16">
          {{dialogSend}}
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import Head from '@/components/Bg'
export default {
  name: 'supervisionDetail',
  data () {
    return {
      centerDialogVisible: false,
      clickOn: false,
      user: '543759843@qq.com',
      nowIndex: 0,
      temp1: 1,
      tempe: 2,
      nowIndex1: 1,
      cs: [
        {name: '账户资料', t: 1},
        {name: '安全设置', t: 2}
      ],
      head: {
        platform: '督导管理',
        analysis: '详情',
        name: '名字 ',
        methods: 'greet'
      },
      checked: false,
      showDialog: false,
      afterSend: false,
      tableData: [
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        },
        {
          province: '江苏',
          city: '苏州',
          hospital: '苏州大学附属第一医院',
          person: '高文妹',
          phone: '15268256486',
          email: 'libaoxys@163.com'
        }
      ],
      tableHeight: 0,
      dialogSend: '邮件发送成功'
    }
  },
  methods: {
    greet: function () {
      this.centerDialogVisible = true
    },
    sorts (event, index, t) {
      this.nowIndex = index
      this.temp1 = t
    },
    send (data) {
      this.dialogText = '发送邮件到这家医院'
      this.showDialog = true
      console.log(data)
    },
    sends (data) {
      this.dialogText = '批量发送邮件到医院'
      this.showDialog = true
      console.log(data)
    },
    confirmSend () {
      this.showDialog = false
      const loading = this.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })
      setTimeout(() => {
        loading.close()
        this.afterSend = true
      }, 1000)
    }
  },
  components: {
    Head
  },
  mounted () {
    let title = this.$route.query.title
    this.head.analysis = title

    window.onresize = () => {
      this.tableHeight = document.getElementsByClassName('el-main')[0].clientHeight - 10
    }
    this.$nextTick(() => {
      this.tableHeight = document.getElementsByClassName('el-main')[0].clientHeight - 10
    })
  }
}
</script>

<style scoped>
  /*布局样式*/
  .el-header, .el-footer {
    height: 120px!important;
    color:#fff;
    background:url(/static/assets/img/titlebg1.png) no-repeat center center;
  }
  .el-aside {
    background-color: #f9f9f9;
    color: #fff;
    text-align: center;
    line-height: 200px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
    -moz-box-shadow: rgb(167, 168, 169) 2px 0px 12px;/* 老的 Firefox */
    box-shadow: rgb(167, 168, 169) 2px 0px 12px;
  }
  body > .el-container {
    margin-bottom: 40px;
  }
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
  .el-main{
    text-align: center;
  }
  .main{
    width: 1080px;
    margin: 0 auto;
    /*min-height: 100%;*/
    background: white;
    border-radius: 8px;
    padding: 5px;
  }
  .footer{
    height: 78px;
    width: 1080px;
    margin: 0 auto;
    background: white;
    position: absolute;
    bottom: 0;
    left: 50%;
    margin-left: -540px;
    border-radius: 8px 8px 0 0;
  }
  .btn_color{
    width: 60px;
    border: 1px solid #E54E62;
    color:#E54E62;
    background: transparent;
    padding: 5px 0;
    border-radius: 15px;
  }
</style>
